﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace CommunitySystem.PageView
{
    public partial class UpLoadCon : UserControl
    {
        public UpLoadCon(FileCollection f)
        {
            InitializeComponent();
            FilesList = f;
            if (f != null) { if (f.Count > 0) this.OKButton.Visibility = Visibility.Collapsed; }

            FileList.ItemsSource =f;
          
        }
        public CommunitySystem.JinShengService.JinShen_CompetSpeech_Detail detail;
                         
        public FileCollection FilesList;
        private FileCollection _Files;
        public FileCollection Files { 
            get { return _Files; }
            set
            {
                FileList.ItemsSource = null;
                FileList.ItemsSource = FilesList; }
        }
     
    
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            //this.DialogResult = true;
            if (FilesList == null)
            {
                SilverlightMessageBoxLibrary.Message.ErrorMessage("请选择上传的附件！");
                return;
                if (FilesList.Count == 0)
                {
                    SilverlightMessageBoxLibrary.Message.ErrorMessage("请选择上传的附件！");
                    return;
                }
                    
                  
            }
            else
            {

                FilesList.UploadFiles();

            }
        }

    }
}

